void main(){
  // 准备购物车数据
  List carts = [
    {"count": 2, "price": 10.0, "selected": true},
    {"count": 1, "price": 30.0, "selected": false},
    {"count": 5, "price": 20.0, "selected": true}
  ];

  // bool res = getCartsSelected(carts);
  // res? print("全选") : print("未全选");

  bool res=carts.every((item){
    return item["selected"];
  });
  
  res? print("全选") : print("未全选");
}

bool getCartsSelected(List carts){
  bool res=true;
  for(var i=0;i<carts.length;i++){
    if(!carts[i]["selected"]){
      res=false;
      break;
    }
  }
  return res;
}